import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { NzInputModule } from 'ng-zorro-antd/input';

@Component({
  selector: 'app-input-checkbox',
  standalone: true,
  imports: [NzInputModule, FormsModule],
  template: `
    <div class="demo demo-space">
      @for (opt of options; track $index; ) {
      <input nz-input [(ngModel)]="opt.checked" type="checkbox" [id]="$index" />
      <label [for]="$index">{{ opt.label }}</label>
      }
    </div>
  `,
  styles: ``,
})
export class InputCheckboxListComponent {
  options = [
    { label: '选项一', value: '1', checked: true },
    { label: '选项二', value: '2' },
    { label: '选项三', value: '3' },
  ];
}
